import request from '@/utils/request'

export function getMenus(query) {
  return request({
    url: '/api/menu/get_list',
    method: 'get'
  })
}
export function getRadder(query) {
  return request({
    url: '/api/dashboard/rad_chart',
    method: 'get',
    params: query
  })
}
export function getChart(query) {
  return request({
    url: '/api/dashboard/line_chart',
    method: 'get',
    params: query
  })
}
export function fetchArticle(id) {
  return request({
    url: '/api/article/detail',
    method: 'get',
    params: { id }
  })
}

export function del(id) {
  return request({
    url: '/api/article/delete',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createMenus(data) {
  return request({
    url: '/api/menu/create_menu',
    method: 'post',
    data
  })
}

export function delMenus(id){
  return request({
    url: '/api/menu/del_menu',
    method: 'get',
    params: { id }
  })
}

export function updateArticle(data) {
  return request({
    url: '/vue-element-admin/article/update',
    method: 'post',
    data
  })
}
